const { spawn } = require('child_process');

const pythonProcess = spawn('python', ['D:/coding/toy/wuta_admin/test/ChatMiniChinese.py', '红烧肉怎么做！']);

pythonProcess.stdout.setEncoding('utf-8');

pythonProcess.stdout.on('data', (data) => {
  console.log(`Python script output: ${data}`);
});

pythonProcess.stderr.on('data', (data) => {
  console.error(`Error: ${data}`);
});

pythonProcess.on('close', (code) => {
  console.log(`Child process exited with code ${code}`);
});